package com.example.demo.util;


import lombok.Getter;

/**
 * @author xiah
 * @date 2018/5/30 10:35
 */
public enum ColorEnum {
       /**
        * 头像
        */
       RED("red", "<span style='color:red'>");

       @Getter
       private String tag;

       @Getter
       private String storagePath;

       ColorEnum(String tag, String storagePath) {
              this.tag = tag;
              this.storagePath = storagePath;
       }

       public static String getByStoragePath(String tag) {
              ColorEnum[] fileMarkes = ColorEnum.values();
              for ( ColorEnum fileMarke : fileMarkes ) {
                     if ( fileMarke.tag.equalsIgnoreCase(tag) ) {
                            return fileMarke.storagePath;
                     }
              }
              return null;
       }
}
